import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { HttpService } from 'src/app/service/http.service';
import { MineService } from 'src/app/service/mine.service';

@Component({
  selector: 'app-settings',
  templateUrl: './settings.page.html',
  styleUrls: ['./settings.page.scss'],
})
export class SettingsPage implements OnInit {

  constructor(private router: Router, private httpService: HttpService, private mineService: MineService) { }

  ngOnInit() { }

  async quit() {
    const refreshToken = this.mineService.getRefreshToken()
    await this.httpService.logout(refreshToken)
    this.mineService.resetLoginData()
    this.router.navigate(['/login'])
  }
}
